using UnityEngine;
using System.Collections;

public class RockSpawner : MonoBehaviour 
{
	public float timer;
	public float randomTimer;
	public GameObject spawner;
	public GameObject rock;
	
	void Start () 
	{
		randomTimer = Random.Range(3, 7);
	}
	
	void Update () 
	{
		timer += Time.deltaTime;
		
		if(timer >= randomTimer)
		{
			Instantiate(rock, spawner.transform.position, Quaternion.Euler(90, 180, 0));
			randomTimer = Random.Range(3, 7);
			timer = 0;
		}
	}
}
